package com.dubbo.service.impl;

import com.dubbo.mapper.StorageMapper;
import com.dubbo.pojo.Storage;
import com.dubbo.service.StorageService;
import org.apache.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Resource;

@Service
public class StorageServiceImpl implements StorageService {

    @Resource
    StorageMapper storageMapper;

    Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public int decreaseStorage(Storage storageDTO) {

        logger.info("开始扣减库存。商品编号:{}",storageDTO.getCommodityCode());
//        int a=1/0;
        return storageMapper.decreaseStorage(storageDTO);
    }
}
